#include "StdAfx.h"
#include ".\roomrenamedlg.h"

CRoomRenameDlg::CRoomRenameDlg(void)
{
}

CRoomRenameDlg::~CRoomRenameDlg(void)
{
}



LRESULT CRoomRenameDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CenterWindow(GetParent());

	ResetDlgText( );

	SetDlgItemText( IDC_EDIT_NAME, m_strRoomName.c_str() ); 
	
	return TRUE;
}

LRESULT CRoomRenameDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	EndDialog(wID);
	return 0;
}

LRESULT CRoomRenameDlg::OnBtnCancelBnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl)
{
	EndDialog(wID);
	return 0;
}

LRESULT CRoomRenameDlg::OnBtnOkBnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl)
{	
	WCHAR szBuffer[512] = {0};
	GetDlgItemText( IDC_EDIT_NAME, szBuffer, 512 ); 

	m_strRoomName = wstring(szBuffer);

	//EndDialog(wID);
	EndDialog(IDOK);
	return 0;
}


int CRoomRenameDlg::ResetDlgText(void)
{
	SetWindowText( GetMsgText( DLG_RENAME_CAPTION ) );

	SetDlgItemText( IDC_STATIC_NAME,  GetMsgText( DLG_RENAME_NAME ) );

	SetDlgItemText( IDC_BTN_OK,  GetMsgText( BTN_OK_CAPTION ) );

	SetDlgItemText( IDC_BTN_CANCEL,  GetMsgText( BTN_CANCEL_CAPTION ) );

	return 0;
}

int CRoomRenameDlg::SetRoomName(wstring strName)
{
	m_strRoomName = strName;
	return 0;
}

wstring CRoomRenameDlg::GetRoomName(void)
{
	return m_strRoomName;
}
